package com.ssm.gbq.dao.impl;

import com.ssm.gbq.dao.FlowersDao;
import com.ssm.gbq.mapper.FlowersMapper;
import com.ssm.gbq.model.Flowers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


import java.util.List;

@Repository
public class FlowersDaoImpl implements FlowersDao {

    @Autowired
    private FlowersMapper flowersMapper;

    public List<Flowers> showFlowersByPage(Flowers flowers, int currentPage, int pageSize) throws Exception {
        return flowersMapper.showFlowersByPage(flowers, currentPage, pageSize);
    }

    public List<Flowers> showFlowersTable() {
        return flowersMapper.showFlowersTable();
    }

    public Flowers getFlowersById(Integer id) throws Exception {
        return flowersMapper.getFlowersById(id);
    }

    public int updateFlower(Flowers flowers) throws Exception {
        return flowersMapper.updateFlower(flowers);
    }

    public int addFlower(Flowers flowers) throws Exception {
        return flowersMapper.addFlower(flowers);
    }

    public int delFlower(Integer id) throws Exception {
        return flowersMapper.delFlower(id);
    }

    public int getFlowersCount(Flowers flowers) {
        return flowersMapper.getFlowersCount(flowers);
    }

    public int deleteFlowers(List<Integer> ids) {
        return flowersMapper.deleteFlowers(ids);
    }

}
